package com.ws.wsapp.chrome.dao;

import java.util.List;
import java.util.Map;

import com.ws.base.common.entity.CreateEntity;
import com.ws.base.db.common.order.Order;
import com.ws.base.db.common.page.Page;
import com.ws.base.db.support.DBSqlIdSupport;
import com.ws.wsapp.chrome.entity.TimingTasks;

public class TimingTasksDao {
    private DBSqlIdSupport dbSqlIdSupport;

    public boolean addTimingTasks(TimingTasks timingTasks) {
        dbSqlIdSupport.add("ws_timingTasks_add", timingTasks.toMap());
        return true;
    }

    public boolean updateTimingTasks(TimingTasks timingTasks) {
        dbSqlIdSupport.update("ws_timingTasks_update", timingTasks.toMap());
        return true;
    }

    public List<TimingTasks> queryTimingTasks(Map<String, Object> condition,
            Page page, Order order) {
        List<Map<String, Object>> list = dbSqlIdSupport.query(
                "ws_timingTasks_query", condition, page, order);
        List<TimingTasks> timingTasks = CreateEntity.getInstance().map2ListObj(
                list, TimingTasks.class);
        return timingTasks;
    }

    public DBSqlIdSupport getDbSqlIdSupport() {
        return dbSqlIdSupport;
    }

    public void setDbSqlIdSupport(DBSqlIdSupport dbSqlIdSupport) {
        this.dbSqlIdSupport = dbSqlIdSupport;
    }

}
